home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / binutils.7 / binutils / binutils-2.7 / ld / ld.info-3 < prev    next >
Encoding:
GNU Info File  |  1996-07-15  |  23.8 KB  |  515 lines

  1. This is Info file ld.info, produced by Makeinfo-1.55 from the input
  2. file ./ld.texinfo.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * Ld: (ld).                       The GNU linker.
  6. END-INFO-DIR-ENTRY
  7.  
  8.    This file documents the GNU linker LD.
  9.  
  10.    Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation,
  11. Inc.
  12.  
  13.    Permission is granted to make and distribute verbatim copies of this
  14. manual provided the copyright notice and this permission notice are
  15. preserved on all copies.
  16.  
  17.    Permission is granted to copy and distribute modified versions of
  18. this manual under the conditions for verbatim copying, provided also
  19. that the entire resulting derived work is distributed under the terms
  20. of a permission notice identical to this one.
  21.  
  22.    Permission is granted to copy and distribute translations of this
  23. manual into another language, under the above conditions for modified
  24. versions.
  25.  
  26. 
  27. File: ld.info,  Node: MRI,  Next: Index,  Prev: BFD,  Up: Top
  28.  
  29. MRI Compatible Script Files
  30. ***************************
  31.  
  32.    To aid users making the transition to GNU `ld' from the MRI linker,
  33. `ld' can use MRI compatible linker scripts as an alternative to the
  34. more general-purpose linker scripting language described in *Note
  35. Command Language: Commands.  MRI compatible linker scripts have a much
  36. simpler command set than the scripting language otherwise used with
  37. `ld'.  GNU `ld' supports the most commonly used MRI linker commands;
  38. these commands are described here.
  39.  
  40.    In general, MRI scripts aren't of much use with the `a.out' object
  41. file format, since it only has three sections and MRI scripts lack some
  42. features to make use of them.
  43.  
  44.    You can specify a file containing an MRI-compatible script using the
  45. `-c' command-line option.
  46.  
  47.    Each command in an MRI-compatible script occupies its own line; each
  48. command line starts with the keyword that identifies the command (though
  49. blank lines are also allowed for punctuation).  If a line of an
  50. MRI-compatible script begins with an unrecognized keyword, `ld' issues
  51. a warning message, but continues processing the script.
  52.  
  53.    Lines beginning with `*' are comments.
  54.  
  55.    You can write these commands using all upper-case letters, or all
  56. lower case; for example, `chip' is the same as `CHIP'.  The following
  57. list shows only the upper-case form of each command.
  58.  
  59. `ABSOLUTE SECNAME'
  60. `ABSOLUTE SECNAME, SECNAME, ... SECNAME'
  61.      Normally, `ld' includes in the output file all sections from all
  62.      the input files.  However, in an MRI-compatible script, you can
  63.      use the `ABSOLUTE' command to restrict the sections that will be
  64.      present in your output program.  If the `ABSOLUTE' command is used
  65.      at all in a script, then only the sections named explicitly in
  66.      `ABSOLUTE' commands will appear in the linker output.  You can
  67.      still use other input sections (whatever you select on the command
  68.      line, or using `LOAD') to resolve addresses in the output file.
  69.  
  70. `ALIAS OUT-SECNAME, IN-SECNAME'
  71.      Use this command to place the data from input section IN-SECNAME
  72.      in a section called OUT-SECNAME in the linker output file.
  73.  
  74.      IN-SECNAME may be an integer.
  75.  
  76. `ALIGN SECNAME = EXPRESSION'
  77.      Align the section called SECNAME to EXPRESSION.  The EXPRESSION
  78.      should be a power of two.
  79.  
  80. `BASE EXPRESSION'
  81.      Use the value of EXPRESSION as the lowest address (other than
  82.      absolute addresses) in the output file.
  83.  
  84. `CHIP EXPRESSION'
  85. `CHIP EXPRESSION, EXPRESSION'
  86.      This command does nothing; it is accepted only for compatibility.
  87.  
  88. `END'
  89.      This command does nothing whatever; it's only accepted for
  90.      compatibility.
  91.  
  92. `FORMAT OUTPUT-FORMAT'
  93.      Similar to the `OUTPUT_FORMAT' command in the more general linker
  94.      language, but restricted to one of these output formats:
  95.  
  96.        1. S-records, if OUTPUT-FORMAT is `S'
  97.  
  98.        2. IEEE, if OUTPUT-FORMAT is `IEEE'
  99.  
  100.        3. COFF (the `coff-m68k' variant in BFD), if OUTPUT-FORMAT is
  101.           `COFF'
  102.  
  103. `LIST ANYTHING...'
  104.      Print (to the standard output file) a link map, as produced by the
  105.      `ld' command-line option `-M'.
  106.  
  107.      The keyword `LIST' may be followed by anything on the same line,
  108.      with no change in its effect.
  109.  
  110. `LOAD FILENAME'
  111. `LOAD FILENAME, FILENAME, ... FILENAME'
  112.      Include one or more object file FILENAME in the link; this has the
  113.      same effect as specifying FILENAME directly on the `ld' command
  114.      line.
  115.  
  116. `NAME OUTPUT-NAME'
  117.      OUTPUT-NAME is the name for the program produced by `ld'; the
  118.      MRI-compatible command `NAME' is equivalent to the command-line
  119.      option `-o' or the general script language command `OUTPUT'.
  120.  
  121. `ORDER SECNAME, SECNAME, ... SECNAME'
  122. `ORDER SECNAME SECNAME SECNAME'
  123.      Normally, `ld' orders the sections in its output file in the order
  124.      in which they first appear in the input files.  In an
  125.      MRI-compatible script, you can override this ordering with the
  126.      `ORDER' command.  The sections you list with `ORDER' will appear
  127.      first in your output file, in the order specified.
  128.  
  129. `PUBLIC NAME=EXPRESSION'
  130. `PUBLIC NAME,EXPRESSION'
  131. `PUBLIC NAME EXPRESSION'
  132.      Supply a value (EXPRESSION) for external symbol NAME used in the
  133.      linker input files.
  134.  
  135. `SECT SECNAME, EXPRESSION'
  136. `SECT SECNAME=EXPRESSION'
  137. `SECT SECNAME EXPRESSION'
  138.      You can use any of these three forms of the `SECT' command to
  139.      specify the start address (EXPRESSION) for section SECNAME.  If
  140.      you have more than one `SECT' statement for the same SECNAME, only
  141.      the *first* sets the start address.
  142.  
  143. 
  144. File: ld.info,  Node: Index,  Prev: MRI,  Up: Top
  145.  
  146. Index
  147. *****
  148.  
  149. * Menu:
  150.  
  151. * ":                                    Symbols.
  152. * *( COMMON ):                          Section Placement.
  153. * *(SECTION):                           Section Placement.
  154. * -(:                                   Options.
  155. * -architecture=ARCH:                   Options.
  156. * -cref:                                Options.
  157. * -defsym SYMBOL=EXP:                   Options.
  158. * -discard-all:                         Options.
  159. * -discard-locals:                      Options.
  160. * -dynamic-linker FILE:                 Options.
  161. * -entry=ENTRY:                         Options.
  162. * -force-exe-suffix:                    Options.
  163. * -format=FORMAT:                       Options.
  164. * -gpsize:                              Options.
  165. * -help:                                Options.
  166. * -just-symbols=FILE:                   Options.
  167. * -library-path=DIR:                    Options.
  168. * -library=ARCHIVE:                     Options.
  169. * -mri-script=MRI-CMDFILE:              Options.
  170. * -nmagic:                              Options.
  171. * -no-keep-memory:                      Options.
  172. * -no-whole-archive:                    Options.
  173. * -noinhibit-exec:                      Options.
  174. * -omagic:                              Options.
  175. * -output=OUTPUT:                       Options.
  176. * -print-map:                           Options.
  177. * -relax:                               Options.
  178. * -relocateable:                        Options.
  179. * -script=SCRIPT:                       Options.
  180. * -sort-common:                         Options.
  181. * -split-by-file:                       Options.
  182. * -split-by-reloc:                      Options.
  183. * -stats:                               Options.
  184. * -strip-all:                           Options.
  185. * -strip-debug:                         Options.
  186. * -trace:                               Options.
  187. * -trace-symbol=SYMBOL:                 Options.
  188. * -undefined=SYMBOL:                    Options.
  189. * -verbose:                             Options.
  190. * -version:                             Options.
  191. * -whole-archive:                       Options.
  192. * -wrap:                                Options.
  193. * -AARCH:                               Options.
  194. * -aKEYWORD:                            Options.
  195. * -assert KEYWORD:                      Options.
  196. * -b FORMAT:                            Options.
  197. * -Bdynamic:                            Options.
  198. * -Bshareable:                          Options.
  199. * -Bstatic:                             Options.
  200. * -Bsymbolic:                           Options.
  201. * -c MRI-CMDFILE:                       Options.
  202. * -call_shared:                         Options.
  203. * -d:                                   Options.
  204. * -dc:                                  Options.
  205. * -dn:                                  Options.
  206. * -dp:                                  Options.
  207. * -dy:                                  Options.
  208. * -E:                                   Options.
  209. * -e ENTRY:                             Options.
  210. * -EB:                                  Options.
  211. * -EL:                                  Options.
  212. * -embedded-relocs:                     Options.
  213. * -export-dynamic:                      Options.
  214. * -F:                                   Options.
  215. * -g:                                   Options.
  216. * -G:                                   Options.
  217. * -hNAME:                               Options.
  218. * -i:                                   Options.
  219. * -lARCHIVE:                            Options.
  220. * -LDIR:                                Options.
  221. * -M:                                   Options.
  222. * -m EMULATION:                         Options.
  223. * -Map:                                 Options.
  224. * -n:                                   Options.
  225. * -N:                                   Options.
  226. * -non_shared:                          Options.
  227. * -o OUTPUT:                            Options.
  228. * -oformat:                             Options.
  229. * -qmagic:                              Options.
  230. * -Qy:                                  Options.
  231. * -r:                                   Options.
  232. * -R FILE:                              Options.
  233. * -rpath:                               Options.
  234. * -rpath-link:                          Options.
  235. * -s:                                   Options.
  236. * -S:                                   Options.
  237. * -shared:                              Options.
  238. * -soname=NAME:                         Options.
  239. * -static:                              Options.
  240. * -t:                                   Options.
  241. * -T SCRIPT:                            Options.
  242. * -Tbss ORG:                            Options.
  243. * -Tdata ORG:                           Options.
  244. * -traditional-format:                  Options.
  245. * -Ttext ORG:                           Options.
  246. * -u SYMBOL:                            Options.
  247. * -Ur:                                  Options.
  248. * -v:                                   Options.
  249. * -V:                                   Options.
  250. * -warn-comon:                          Options.
  251. * -warn-constructors:                   Options.
  252. * -warn-multiple-gp:                    Options.
  253. * -warn-once:                           Options.
  254. * -X:                                   Options.
  255. * -x:                                   Options.
  256. * -Y PATH:                              Options.
  257. * -y SYMBOL:                            Options.
  258. * -z KEYWORD:                           Options.
  259. * .:                                    Location Counter.
  260. * 0x:                                   Integers.
  261. * :PHDR:                                Section Options.
  262. * ;:                                    Assignment.
  263. * =FILL:                                Section Options.
  264. * >REGION:                              Section Options.
  265. * -relax on i960:                       i960.
  266. * ABSOLUTE (MRI):                       MRI.
  267. * ALIAS (MRI):                          MRI.
  268. * ALIGN (MRI):                          MRI.
  269. * BASE (MRI):                           MRI.
  270. * CHIP (MRI):                           MRI.
  271. * END (MRI):                            MRI.
  272. * FORMAT (MRI):                         MRI.
  273. * LIST (MRI):                           MRI.
  274. * LOAD (MRI):                           MRI.
  275. * NAME (MRI):                           MRI.
  276. * ORDER (MRI):                          MRI.
  277. * PUBLIC (MRI):                         MRI.
  278. * SECT (MRI):                           MRI.
  279. * [SECTION...], not supported:          Section Placement.
  280. * GNU linker:                           Overview.
  281. * FILENAME:                             Section Placement.
  282. * FILENAME(SECTION):                    Section Placement.
  283. * SYMBOL = EXPRESSION ;:                Section Data Expressions.
  284. * SYMBOL F= EXPRESSION ;:               Section Data Expressions.
  285. * absolute and relocatable symbols:     Assignment.
  286. * ABSOLUTE(EXP):                        Arithmetic Functions.
  287. * ADDR(SECTION):                        Arithmetic Functions.
  288. * ALIGN(EXP):                           Arithmetic Functions.
  289. * aligning sections:                    Section Options.
  290. * allocating memory:                    MEMORY.
  291. * architectures:                        Options.
  292. * archive files, from cmd line:         Options.
  293. * arithmetic:                           Expressions.
  294. * arithmetic operators:                 Operators.
  295. * assignment in scripts:                Assignment.
  296. * assignment, in section defn:          Section Data Expressions.
  297. * AT ( LDADR ):                         Section Options.
  298. * back end:                             BFD.
  299. * BFD canonical format:                 Canonical format.
  300. * BFD requirements:                     BFD.
  301. * big-endian objects:                   Options.
  302. * binary input files:                   Option Commands.
  303. * binary input format:                  Options.
  304. * BLOCK(ALIGN):                         Section Options.
  305. * BYTE(EXPRESSION):                     Section Data Expressions.
  306. * C++ constructors, arranging in link:  Option Commands.
  307. * combining symbols, warnings on:       Options.
  308. * command files:                        Commands.
  309. * command line:                         Options.
  310. * commands, fundamental:                Scripts.
  311. * comments:                             Scripts.
  312. * common allocation:                    Option Commands.
  313. * common allocation:                    Options.
  314. * commons in output:                    Section Placement.
  315. * compatibility, MRI:                   Options.
  316. * CONSTRUCTORS:                         Option Commands.
  317. * constructors:                         Options.
  318. * constructors, arranging in link:      Option Commands.
  319. * contents of a section:                Section Placement.
  320. * CREATE_OBJECT_SYMBOLS:                Section Data Expressions.
  321. * cross reference table:                Options.
  322. * current output location:              Location Counter.
  323. * dbx:                                  Options.
  324. * decimal integers:                     Integers.
  325. * default input format:                 Environment.
  326. * DEFINED(SYMBOL):                      Arithmetic Functions.
  327. * deleting local symbols:               Options.
  328. * direct output:                        Section Data Expressions.
  329. * discontinuous memory:                 MEMORY.
  330. * dot:                                  Location Counter.
  331. * dynamic linker, from command line:    Options.
  332. * dynamic symbol table:                 Options.
  333. * ELF program headers:                  PHDRS.
  334. * emulation:                            Options.
  335. * endianness:                           Options.
  336. * entry point, defaults:                Entry Point.
  337. * entry point, from command line:       Options.
  338. * ENTRY(SYMBOL):                        Entry Point.
  339. * expression evaluation order:          Evaluation.
  340. * expression syntax:                    Expressions.
  341. * expression, absolute:                 Arithmetic Functions.
  342. * expressions in a section:             Section Data Expressions.
  343. * filename symbols:                     Section Data Expressions.
  344. * files and sections, section defn:     Section Placement.
  345. * files, including in output sections:  Section Placement.
  346. * fill pattern, entire section:         Section Options.
  347. * FILL(EXPRESSION):                     Section Data Expressions.
  348. * first input file:                     Option Commands.
  349. * first instruction:                    Entry Point.
  350. * FLOAT:                                Option Commands.
  351. * FORCE_COMMON_ALLOCATION:              Option Commands.
  352. * format, output file:                  Option Commands.
  353. * functions in expression language:     Arithmetic Functions.
  354. * fundamental script commands:          Scripts.
  355. * GNUTARGET:                            Option Commands.
  356. * GNUTARGET:                            Environment.
  357. * GROUP ( FILES ):                      Option Commands.
  358. * grouping input files:                 Option Commands.
  359. * groups of archives:                   Options.
  360. * H8/300 support:                       H8/300.
  361. * header size:                          Arithmetic Functions.
  362. * help:                                 Options.
  363. * hexadecimal integers:                 Integers.
  364. * holes:                                Location Counter.
  365. * holes, filling:                       Section Data Expressions.
  366. * i960 support:                         i960.
  367. * including an entire archive:          Options.
  368. * incremental link:                     Options.
  369. * INPUT ( FILES ):                      Option Commands.
  370. * input file format:                    Option Commands.
  371. * input filename symbols:               Section Data Expressions.
  372. * input files, displaying:              Options.
  373. * input files, section defn:            Section Placement.
  374. * input format:                         Options.
  375. * input format:                         Options.
  376. * input sections to output section:     Section Placement.
  377. * integer notation:                     Integers.
  378. * integer suffixes:                     Integers.
  379. * internal object-file format:          Canonical format.
  380. * K and M integer suffixes:             Integers.
  381. * l =:                                  MEMORY.
  382. * L, deleting symbols beginning:        Options.
  383. * layout of output file:                Scripts.
  384. * lazy evaluation:                      Evaluation.
  385. * len =:                                MEMORY.
  386. * LENGTH =:                             MEMORY.
  387. * link map:                             Options.
  388. * link map:                             Options.
  389. * link-time runtime library search path: Options.
  390. * little-endian objects:                Options.
  391. * load address, specifying:             Section Options.
  392. * loading, preventing:                  Section Options.
  393. * local symbols, deleting:              Options.
  394. * location counter:                     Location Counter.
  395. * LONG(EXPRESSION):                     Section Data Expressions.
  396. * M and K integer suffixes:             Integers.
  397. * machine architecture, output:         Option Commands.
  398. * machine dependencies:                 Machine Dependent.
  399. * MEMORY:                               MEMORY.
  400. * memory region attributes:             MEMORY.
  401. * memory regions and sections:          Section Options.
  402. * memory usage:                         Options.
  403. * MIPS embedded PIC code:               Options.
  404. * MRI compatibility:                    MRI.
  405. * names:                                Symbols.
  406. * naming memory regions:                MEMORY.
  407. * naming output sections:               Section Definition.
  408. * naming the output file:               Option Commands.
  409. * naming the output file:               Options.
  410. * negative integers:                    Integers.
  411. * NEXT(EXP):                            Arithmetic Functions.
  412. * NMAGIC:                               Options.
  413. * NOFLOAT:                              Option Commands.
  414. * NOLOAD:                               Section Options.
  415. * Non constant expression:              Assignment.
  416. * o =:                                  MEMORY.
  417. * objdump -i:                           BFD.
  418. * object file management:               BFD.
  419. * object files:                         Options.
  420. * object formats available:             BFD.
  421. * object size:                          Options.
  422. * octal integers:                       Integers.
  423. * OMAGIC:                               Options.
  424. * opening object files:                 BFD outline.
  425. * Operators for arithmetic:             Operators.
  426. * options:                              Options.
  427. * org =:                                MEMORY.
  428. * ORIGIN =:                             MEMORY.
  429. * OUTPUT ( FILENAME ):                  Option Commands.
  430. * output file after errors:             Options.
  431. * output file layout:                   Scripts.
  432. * OUTPUT_ARCH ( BFDNAME ):              Option Commands.
  433. * OUTPUT_FORMAT ( BFDNAME ):            Option Commands.
  434. * partial link:                         Options.
  435. * path for libraries:                   Option Commands.
  436. * PHDRS:                                PHDRS.
  437. * precedence in expressions:            Operators.
  438. * prevent unnecessary loading:          Section Options.
  439. * program headers:                      PHDRS.
  440. * program headers and sections:         Section Options.
  441. * provide:                              Assignment.
  442. * QUAD(EXPRESSION):                     Section Data Expressions.
  443. * quoted symbol names:                  Symbols.
  444. * read-only text:                       Options.
  445. * read/write from cmd line:             Options.
  446. * regions of memory:                    MEMORY.
  447. * relaxing addressing modes:            Options.
  448. * relaxing on H8/300:                   H8/300.
  449. * relaxing on i960:                     i960.
  450. * relocatable and absolute symbols:     Assignment.
  451. * relocatable output:                   Options.
  452. * requirements for BFD:                 BFD.
  453. * retaining specified symbols:          Options.
  454. * rounding up location counter:         Arithmetic Functions.
  455. * runtime library name:                 Options.
  456. * runtime library search path:          Options.
  457. * scaled integers:                      Integers.
  458. * script files:                         Options.
  459. * search directory, from cmd line:      Options.
  460. * search path, libraries:               Option Commands.
  461. * SEARCH_DIR ( PATH ):                  Option Commands.
  462. * section address:                      Section Options.
  463. * section address:                      Arithmetic Functions.
  464. * section alignment:                    Section Options.
  465. * section definition:                   Section Definition.
  466. * section defn, full syntax:            Section Options.
  467. * section fill pattern:                 Section Options.
  468. * section size:                         Arithmetic Functions.
  469. * section start:                        Section Options.
  470. * section, assigning to memory region:  Section Options.
  471. * section, assigning to program header: Section Options.
  472. * SECTIONS:                             SECTIONS.
  473. * segment origins, cmd line:            Options.
  474. * semicolon:                            Assignment.
  475. * shared libraries:                     Options.
  476. * SHORT(EXPRESSION):                    Section Data Expressions.
  477. * SIZEOF(SECTION):                      Arithmetic Functions.
  478. * SIZEOF_HEADERS:                       Arithmetic Functions.
  479. * sizeof_headers:                       Arithmetic Functions.
  480. * specify load address:                 Section Options.
  481. * standard Unix system:                 Options.
  482. * start address, section:               Section Options.
  483. * start of execution:                   Entry Point.
  484. * STARTUP ( FILENAME ):                 Option Commands.
  485. * strip all symbols:                    Options.
  486. * strip debugger symbols:               Options.
  487. * stripping all but some symbols:       Options.
  488. * suffixes for integers:                Integers.
  489. * symbol defaults:                      Arithmetic Functions.
  490. * symbol definition, scripts:           Assignment.
  491. * symbol names:                         Symbols.
  492. * symbol tracing:                       Options.
  493. * symbol-only input:                    Options.
  494. * symbols, from command line:           Options.
  495. * symbols, relocatable and absolute:    Assignment.
  496. * symbols, retaining selectively:       Options.
  497. * synthesizing linker:                  Options.
  498. * synthesizing on H8/300:               H8/300.
  499. * TARGET ( FORMAT ):                    Option Commands.
  500. * traditional format:                   Options.
  501. * unallocated address, next:            Arithmetic Functions.
  502. * undefined symbol:                     Options.
  503. * undefined symbols, warnings on:       Options.
  504. * uninitialized data:                   Section Placement.
  505. * unspecified memory:                   Section Data Expressions.
  506. * usage:                                Options.
  507. * variables, defining:                  Assignment.
  508. * verbose:                              Options.
  509. * version:                              Options.
  510. * warnings, on combining symbols:       Options.
  511. * warnings, on undefined symbols:       Options.
  512. * what is this?:                        Overview.
  513.  
  514.  
  515.